export type Method = 'get' | 'GET'
  | 'delete' | 'Delete'
  | 'head' | 'HEAD'
  | 'options' | 'OPTIONS'
  | 'post' | 'POST'
  | 'put' | 'PUT'
  | 'patch' | 'PATCH'

export interface AxiosRequestConfig{
  url: string, //请求路径
  method?: Method, //请求方法
  data?: any, //请求参数
  params?: any, //请求参数
  headers?: any,  //请求头
  responseType?: XMLHttpRequestResponseType,
  timeout?: number; //请求时间
}

export interface AxiosResponse{
  data: any, //返回的数据
  status: number, // Http 状态码
  statusText: string, // 状态消息
  headers: any, //响应头
  config: AxiosRequestConfig, // 请求配置对象
  request: any //请求的 XMLHttpRequest 对象实例
}

export interface AxiosPromise extends Promise<AxiosResponse> {

}

export interface AxiosError extends Error{
  config: AxiosRequestConfig,
  code?: string | null | number,
  request?: any,
  response?: AxiosResponse
}